﻿namespace Bilibili.Model.Bangumi
{
    public sealed class Episodes
    {
        public int Id { get; set; }
        public int Aid { get; set; }
        public int Cid { get; set; }
        public int Ep_Id { get; set; }
        public int Page { get; set; }
        private string av_id;
        public string Av_Id
        {
            get
            {
                if (Aid != 0)
                    return Aid.ToString();
                else
                    return av_id;
            }
            set
            {
                av_id = value;
            }
        }
        private int danmaku;
        public int Danmaku
        {
            get
            {
                if (Cid != 0)
                    return Cid;
                else
                    return danmaku;
            }
            set
            {
                danmaku = value;
            }
        }
        private string episode_id;
        public string Episode_Id
        {
            get
            {
                if (Ep_Id != 0)
                    return Ep_Id.ToString();
                else
                    return episode_id;
            }
            set
            {
                episode_id = value;
            }
        }
        public string Long_Title { get; set; }
        public string Index_Title { get; set; }
        public bool InLocal { get; set; }
        public string Index { get; set; }
        public int OrderIndex { get; set; }
        public string Title { get; set; }
        public int Episode_Status { get; set; }
        public int Section_Type { get; set; }
        public int Season_Type { get; set; } = 1;
        public string Badge { get; set; }
        public bool IsBadge
        {
            get
            {
                return Badge != null && Badge.Length != 0;
            }
        }
    }
}